#include<bits/stdc++.h>

using namespace std;

int main() {
    int a = 1234, b = 567;

    string s, t;
    ostringstream oss1, oss2;

    oss1 << b << a;
    s = oss1.str();//"5671234"


    oss2 << a << b;
    t = oss2.str(); //"123457"

    cout << s << endl;
    cout << t << endl;
    return 0;
}